﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Xml.Serialization;

namespace MDM.GUI.MDM.DataObjects
{
    [Serializable, XmlRoot("Versions")]
    public class Version
    {
        [XmlAttribute("version")]
        public string version;

        [XmlElement("Images", typeof(ImageClass))]
        public ImageClass Images = new ImageClass();

        [XmlElement("Installs", typeof(Install))]
        public Install Installs = new Install();

        [XmlArray("Actions"), XmlArrayItem("Registry", typeof(Registry))
                            , XmlArrayItem("Dos", typeof(Dos))
                            , XmlArrayItem("Service", typeof(Service))
                            , XmlArrayItem("Window", typeof(Window))
                            , XmlArrayItem("Shutdown", typeof(Shutdown))
                            , XmlArrayItem("Restart", typeof(Restart))]
        public ArrayList Actions = new ArrayList();
    }
    [Serializable]
    public class ImageClass
    {
      
        [XmlAttribute("Path")]
        public string Path;
   
    }

    [Serializable]
    public class Install
    {
        [XmlArray("Folders"), XmlArrayItem("Folder", typeof(Folder))]
        public ArrayList Folders = new ArrayList();

        [XmlArray("Files"), XmlArrayItem("File", typeof(File))]
        public ArrayList Files = new ArrayList();
    }

    [Serializable]
    public class Folder
    {
        [XmlAttribute("Path")]
        public string Path;

        [XmlAttribute("Modifier")]
        public string Modifier;
    }

    [Serializable]
    public class File
    {
        [XmlAttribute("Name")]
        public string Name;

        [XmlAttribute("Path")]
        public string Path;

        [XmlAttribute("FileType")]
        public string FileType;

        [XmlAttribute("Size")]
        public string Size;

        [XmlAttribute("Version")]
        public string Version;

        [XmlAttribute("Modifier")]
        public string Modifier;
    }

    [Serializable]
    public class Registry
    {
        [XmlAttribute("Type")]
        public string Type;

        [XmlAttribute("Name")]
        public string Name;

        [XmlAttribute("Key")]
        public string Key;

        [XmlAttribute("Value")]
        public string Value;

        [XmlAttribute("Modifier")]
        public string Modifier;
    }

    [Serializable]
    public class Dos
    {
        [XmlAttribute("Command")]
        public string Command;
    }

    [Serializable]
    public class Service
    {
        [XmlAttribute("File")]
        public string File;

        [XmlAttribute("Type")]
        public string Type;
    }

    [Serializable]
    public class Window
    {
        [XmlAttribute("Type")]
        public string Type;

        [XmlAttribute("Path")]
        public string Path;

        [XmlAttribute("Source")]
        public string Source;

        [XmlAttribute("Destination")]
        public string Destination;
    }

    [Serializable]
    public class Shutdown { }

    [Serializable]
    public class Restart { }





}
